<div class="window user-question-widget {if $mode=="main-page"}main-page-question-widget{/if}">
        <div class="window-head">
                <a href="/question/{$user->user_id}" class="window-title">Вопросы</a>
                {if $modelsCount != 0}
                <p class="window-info">всего: {$modelsCount}</p>
                {/if}
                {if $mode=="main-page"}
                    <a href="/question/all" class="window-link">все</a>
                {else}
                    <a href="/question/{$user->user_id}" class="window-link">все</a>
                {/if}
                {if !Yii::app()->user->isGuest && $isAuthor == true}
                <a href="/question/create" class="window-link">+ добавить</a>
                {/if}
        </div>
        <div class="window-content question-preview">
            {foreach from=$models item="data" name="questLoop"}
                <div class="question-item">
                    <div class="quest-symbol">?</div>
                    <a href="/question/view/{$data->question_id}" class="question-title">«{CHtml::encode($data->title)}»</a>
                    <div class="clear-floating"></div>
                    {assign var="answers" value=CommentFacade::getLatesComment($data->comment_flow_id, 3)}
                    {if count($answers)}
                        <p class="answer-title">Последние ответы:</p>
                        {foreach from=$answers item="comment"}
                            <p class="answer-item">
                                <a class="author" href="{$controller->getUserPageUrl($comment->author_id)}">{UserFacade::getFullNameUser($comment->author_id)}</a>:
                                {$comment->text|truncate:100:"...":true}
                            </p>
                        {/foreach}
                    {else}
                        <p class="answer-title">Пока ответов нет.</p>
                    {/if}
                    <a href="/question/view/{$data->question_id}" class="more"><span>Дать ответ &rarr;</span></a>
                    <div class="clear-floating"></div>
                </div>
            {/foreach}
            <div class="clear-floating"></div>
        </div>
        <div class="window-bottom-left">
                <div class="window-bottom-right">
                </div>
        </div>
</div>
